package com.lagou.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author yutao
 * @create 2020-06-13 16:29
 **/
@Configuration
public class ServerConfig {


    @Autowired
    private ApplicationContext applicationContext;

    @Bean
    public Server startServer() throws InterruptedException {
        Server bootServer = new Server();
        bootServer.setApplicationContext(applicationContext);
        //启动服务器
        bootServer.startServer("127.0.0.1", 8999);
        return bootServer;
    }


}
